package com.example.pharmacy.mapper;

import com.example.pharmacy.model.OrderInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: asus
 * Date: 2024-12-21
 * Time: 20:17
 */
@Mapper
public interface OrderInfoMapper {
    @Select("select * from orders where is_deleted = 0 and user_id = #{userId} order by order_id desc")
    List<OrderInfo> getOrderInfos(Integer userId);

    Integer addOrder(OrderInfo orderInfo);
    Integer updateOrder(OrderInfo orderInfo);
    @Select("select * from orders where is_deleted = 0 and order_id = #{order}")
    OrderInfo getOrderInfoByOrderId(Integer orderId);
    @Select("select count(*) from orders")
    Integer selectCount();
}
